package com.hui.web;

import org.mybatis.spring.batch.MyBatisBatchItemWriter;
import org.mybatis.spring.batch.MyBatisPagingItemReader;
import org.springframework.batch.core.configuration.annotation.JobBuilderFactory;
import org.springframework.batch.core.configuration.annotation.StepBuilderFactory;
import org.springframework.batch.core.launch.JobLauncher;
import org.springframework.batch.item.support.CompositeItemProcessor;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;

/**
 * Created by Hui
 * on 2017/5/18 0018.
 */

public abstract class AbstractLauncher {

    final CompositeItemProcessor compositeItemProcessor;
    final ThreadPoolTaskExecutor taskExecutor;
    final JobLauncher jobLauncher;
    final JobBuilderFactory jobBuilderFactory;
    final StepBuilderFactory stepBuilderFactory;
    final MyBatisBatchItemWriter batisBatchItemWriter;
    final MyBatisPagingItemReader itemReader;


    public AbstractLauncher(CompositeItemProcessor compositeItemProcessor, ThreadPoolTaskExecutor taskExecutor, JobLauncher jobLauncher, JobBuilderFactory jobBuilderFactory, StepBuilderFactory stepBuilderFactory, MyBatisBatchItemWriter batisBatchItemWriter, MyBatisPagingItemReader itemReader) {
        this.compositeItemProcessor = compositeItemProcessor;
        this.taskExecutor = taskExecutor;
        this.jobLauncher = jobLauncher;
        this.jobBuilderFactory = jobBuilderFactory;
        this.stepBuilderFactory = stepBuilderFactory;
        this.batisBatchItemWriter = batisBatchItemWriter;
        this.itemReader = itemReader;
    }


    public abstract void onLauncher();

}
